package pc29;

import java.util.Scanner;

public class J09Account {
	public static void main(String[] args) {

		String aid[] = new String[1];
		String dateCreated[] = { "2014-03-19" };

		int balance[] = new int[1];
		double interestRate[] = new double[1];
		double getMonthlyInterestRate[] = new double[1];
		int withDraw[] = new int[1];
		int deposit[] = new int[1];

		inputAccount(aid, balance, interestRate, withDraw, deposit);
		getMonthlyInterestRate(getMonthlyInterestRate, interestRate);
		withDraw(balance, withDraw);
		deposit(balance, deposit);

		System.out.println("잔액 : " + balance[0]);
		System.out.println("월간이자율 : " + getMonthlyInterestRate[0]);
		System.out.println("통장개설날짜 : " + dateCreated[0]);
	}

	public static void inputAccount(String[] aid, int[] balance,
			double[] interestRate, int[] withDraw, int[] deposit) {

		Scanner sc = new Scanner(System.in);

		System.out.println("계좌번호 입력");
		aid[0] = sc.next();
		System.out.println("통장잔액 입력");
		balance[0] = sc.nextInt();
		System.out.println("연간 이자율 입력");
		interestRate[0] = sc.nextDouble();
		System.out.println("얼마 인출");
		withDraw[0] = sc.nextInt();
		System.out.println("얼마 예금");
		deposit[0] = sc.nextInt();
		
		sc.close();
	}

	public static void getMonthlyInterestRate(double[] getMonthlyInterestRate,
			double[] interestRate) {

		getMonthlyInterestRate[0] = interestRate[0] / 12;
	}

	public static void withDraw(int[] balance, int[] withDraw) {

		balance[0] = balance[0] - withDraw[0];
	}

	public static void deposit(int[] balance, int[] deposit) {

		balance[0] = balance[0] + deposit[0];
	}

}
